using System.Collections.Generic;

using BLToolkit.Data;
using BLToolkit.DataAccess;

using EMan.Common.EnterpriseStructure;
using EMan.Server.Interface.DAL;


namespace EMan.DAL.Firebird
{
  public abstract class EmployeeDalc : Dalc< Employee >, IEmployeeDalc
  {
    [SqlQuery("select * from Employee where DepartmentId = @departmentId")]
    public abstract IList< Employee > GetListByDepartment( int departmentId );

    [SqlQuery("select * from Employee")]
    public abstract IList< Employee > GetList();

    [SqlQuery("select * from Employee where id = @id")]
    public abstract Employee Get( int id );

    [ScalarSource( ScalarSourceType.ReturnValue )]
    public abstract bool Insert( [Direction.Output("Id", "Revision")] Employee employee );

    [ScalarSource( ScalarSourceType.ReturnValue )]
    public abstract bool Update( [Direction.InputOutput("Revision"), Direction.Ignore("Nickname")] Employee employee );

    [SqlQuery("delete from Employee where Id=@Id")]
    public abstract bool Delete( int id );
  }
}